package gui.gui2d.eventsmanager;

import gui.gui2d.highLevelPanels.SelecterPieceJLabel;

import java.awt.Robot;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Observable;

import javax.swing.JLabel;

import utility.Color;
import world.pieces.Bishop;
import world.pieces.Knight;
import world.pieces.Pown;
import world.pieces.Queen;
import world.pieces.Rook;

public class MouseListenerSelecterPiece extends Observable implements MouseListener{

	@Override
	public void mouseClicked(MouseEvent e) {
		SelecterPieceJLabel spjl =(SelecterPieceJLabel) e.getComponent();
		setChanged();
		if(spjl.getId()==1){
			notifyObservers(new Queen(Color.BLACK));

		}else if(spjl.getId()==2){
			notifyObservers(new Rook(Color.BLACK));

		}else if(spjl.getId()==3){
			notifyObservers(new Bishop(Color.BLACK));

		}else if(spjl.getId()==4){
			notifyObservers(new Knight(Color.BLACK));

		}else if(spjl.getId()==5){
			notifyObservers(new Pown(Color.BLACK));
		}
	}

	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub

	}

}
